Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Two-cell addresses truncate unsafely on 32-bit builds, and the central loader-level initrd regression lacks direct coverage.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Adds support for booting kernel-only FIT images without kernel load/entry addresses or an embedded device tree.
Changes:
- Adds configurable FIT kernel relocation and 64-bit address handling.
- Defers initrd fixups until the final DTB is selected.
- Adds Versal high-DDR configuration, documentation, CI, and tests.
| File | Description |
|---|---|
src/fdt.c |
Adds kernel relocation helper and diagnostics. |
src/update_ram.c |
Adds DTB fallback and deferred initrd fixup. |
src/update_disk.c |
Defers initrd fixup and improves address logging. |
src/boot_aarch64.c |
Prints full-width boot addresses. |
include/fdt.h |
Declares the kernel-loading API. |
include/target.h.in |
Exposes the kernel load address. |
Makefile |
Generates the new target setting. |
options.mk |
Defines the kernel relocation option. |
tools/config.mk |
Persists the new configuration variable. |
tools/unit-tests/Makefile |
Enables ramdisk testing. |
tools/unit-tests/unit-fit-gzip.c |
Tests relocation and initrd helpers. |
tools/unit-tests/unit-fdt.c |
Tests two-cell FIT addresses. |
tools/unit-tests/unit-update-disk-fit.c |
Adds the kernel loader stub. |
docs/Targets.md |
Documents supported FIT layouts. |
config/examples/versal_vmk180.config |
Documents optional relocation settings. |
config/examples/versal_vmk180_highddr.config |
Adds a high-DDR Versal example. |
.github/workflows/test-configs.yml |
Builds the new example in CI. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dgarske
force-pushed
the
versal_fit_noload
branch
2 times, most recently
from
October 1, 2026 22:09
37579ca to
4035401
Compare
dgarske
force-pushed
the
versal_fit_noload
branch
4 times, most recently
from
October 13, 2026 19:26
6e0f118 to
04c9312
Compare
dgarske
force-pushed
the
versal_fit_noload
branch
from
October 13, 2026 21:20
04c9312 to
11cfed1
Compare
dgarske
force-pushed
the
versal_fit_noload
branch
from
October 13, 2026 21:39
11cfed1 to
7b5c3b2
Compare
dgarske
force-pushed
the
versal_fit_noload
branch
2 times, most recently
from
October 13, 2026 23:03
edd71d7 to
451ede5
Compare
dgarske
force-pushed
the
versal_fit_noload
branch
from
October 13, 2026 23:42
451ede5 to
27b0e70
Compare
dgarske
force-pushed
the
versal_fit_noload
branch
from
October 14, 2026 00:20
27b0e70 to
04de94c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
A Versal customer FIT built without
load/entryon the kernel node and with nofdtsub-image exposed four problems.No device tree. A kernel-only FIT left
dts_addrNULL anddo_boot()passed that to the kernel.update_ram.chad its configured-DTB fallback in theelseof the FIT branch;update_disk.chad none beyondhal_get_boot_dts(), a weak NULL onlyhal/cm4.cimplements. Both now fall back whenever the FIT yields no device tree, validating the blob and relocating it into the staging window first.No initrd.
fit_load_ramdisk()ran inside the FIT branch against a tree the FIT supplied, so a device tree from the boot firmware never received/chosen/linux,initrd-*. Both loaders defer the fixup until the source is settled, and a ramdisk staged with no tree to name it in is now reported instead of skipped silently.Truncated addresses.
fdt_getprop_address()cast an 8-byteload/entrydown touintptr_t; it now rejects a value the target cannot represent.Wrong exception level.
hal/versal.hdefaulted toBOOT_EL1, dropping only the boot core to EL1 while PSCI brings the secondaries up at EL2 - Linux refuses that withCPUs started in inconsistent modes. The default is nowBOOT_EL2, matching Xilinx U-Boot;BOOT_EL1=1still works but must be stated explicitly.WOLFBOOT_LOAD_KERNEL_ADDRESSstages the FIT kernel at a configured address, mirroring the ramdisk and fpga options, with0honoring the FIT.DDR_HIGH_BASE/DDR_HIGH_SIZE/NO_DDR_LOWreplace theVERSAL_DDR_HIGH_*defines with AArch64-generic ones; the old spellings are still accepted, an incomplete combination is a build error rather than a silently unmapped window, and these and the exception-level options now survive amake config.Testing
Validated on a Versal VMK180: the FIT boots with the device tree from the BIF raw partition, and the exception-level change was confirmed by reading Linux's
__boot_cpu_modeover JTAG with onlyBOOT.BINdiffering between runs. Hosted tests cover the kernel-only-FIT fallback, the initrd ordering and its failure path on both loaders, and a second build of the FDT suite with the pointer bound narrowed to 32 bits exercises the two-cell rejection on a 64-bit host.The disk loader has no DTB-digest machinery, so a device tree supplied from outside the FIT is unauthenticated there and
LINUX_BOOTARGSalways supplies the command line;docs/Targets.mdstates this, and anfdtsub-image is the way to bring such a tree inside the root of trust. VA-cleaning the actual FIT load destinations before the handoff is left as follow-on work.